home *** CD-ROM | disk | FTP | other *** search
- /*
- * WireDevice.h - class definition wire frame device driver.
- *
- * Copyright (C) 1992, Christoph Streit (streit@iam.unibe.ch)
- * University of Berne, Switzerland
- * All rights reserved.
- *
- * This software may be freely copied, modified, and redistributed
- * provided that this copyright notice is preserved on all copies.
- *
- * You may not distribute this software, in whole or in part, as part of
- * any commercial product without the express consent of the authors.
- *
- * There is no warranty or other guarantee of fitness of this software
- * for any purpose. It is provided solely "as is".
- *
- */
-
- #ifndef WireDevice_H
- # define WireDevice_H
-
- #include "DeviceDriver.h"
- #include "BaseWindow.h"
- #include "ViewTransform.h"
-
- /*___________________________________________________________ WireDevice
- *
- * Wire frame device driver. Supports macro definitions.
- */
-
- class WireDevice : public DeviceDriver
- {
- public:
- WireDevice(BaseWindow*, Options*);
- ~WireDevice();
-
- void begin();
- void end(const BoundingBox&);
- void cylinder(const Vector&, const Vector&, real);
- void cone(const Vector&, real, const Vector&, real);
- void polygon(Polygon*);
- void sphere(const Vector&, real);
- void beginMacro(const rcString&);
- void endMacro();
- void executeMacro(const rcString&, const TransMatrix&);
-
- private:
- rcString currentMacroName;
- PolygonList* polys; // Collection of polygons from current macro
- // definition.
-
- BaseWindow* w;
-
- int coneResolution;
- int sphereResolution;
- real* sintable; // Precomputed sin, cos value for fast cone and
- real* costable; // cylinder generation.
- Vector* top;
- Vector* bottom;
-
- PolygonList* unitSphere; // Tesselation of a unit sphere.
- // Origin (0,0,0), radius (1)
- };
-
- #endif // WireDevice_H
-